import request from '@/utils/request'

// 查询教练列表
export function listCoach(query) {
  return request({
    url: '/debao/coach/list',
    method: 'get',
    params: query
  })
}
// 查询所有教练列表
export function alllistCoach(query) {
  return request({
    url: '/debao/coach/all',
    method: 'get',
    params: query
  })
}

// 查询教练详细
export function getCoach(id) {
  return request({
    url: '/debao/coach/' + id,
    method: 'get'
  })
}

// 新增教练
export function addCoach(data) {
  return request({
    url: '/debao/coach',
    method: 'post',
    data: data
  })
}

// 修改教练
export function updateCoach(data) {
  return request({
    url: '/debao/coach',
    method: 'put',
    data: data
  })
}

// 删除教练
export function delCoach(id) {
  return request({
    url: '/debao/coach/' + id,
    method: 'delete'
  })
}
//上下线教练
export function upStatus(data) {
  return request({
    url: '/debao/coach/upStatus',
    method: 'get',
    params: data
  })
}
/**
 * 审核
 * @param param
 * @returns {*}
 */
export function examine(id,status) {
  return request({
    url: '/debao/coach/audit/' + id + '/' + status,
    method: 'post'
  })
}
/**
 * 排序

 * @returns {*}
 */
export function updateSort(id,sort) {
  return request({
    url: '/debao/coach/sortAutocarro/' + id+'/'+sort,
    method: 'post',
  })
}
